
#ifndef FONTSETPANELEXT_H
#define FONTSETPANELEXT_H

#include "Layout.h"
#include "FontDefinition.h"
#include "StringUtil.h"
#include <map>

class TiXmlElement;

class FontsetPanelExt : public FontsetPanel
{
public:
    FontsetPanelExt( const wxString& name, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 616,380 ), long style = wxTAB_TRAVERSAL );
    ~FontsetPanelExt(void);

    /** Set the name of the fontset */
    //void SetFontsetName( const StringUtil::String& name );

    /** Load the page settings from an XML file */
    void LoadPage( TiXmlElement* root );

    /** Save the fontset using a PNG file */
    void SavePNG( TiXmlElement* root, const StringUtil::String& location ) const;

    /** Set the modified flag for the panel */
    void Modify( bool mod );
    /** Check the modified flag for the panel */
    bool IsModified() const;

    /** Get the view gridlines flag (from the parent container) */
    bool GetViewGridlines() const;
    /** Get the view widths flag (from the parent container) */
    bool GetViewWidths() const;


private:
    FontDefinition  mFontDef;
    bool            mIsModified;
    //typedef std::map< StringUtil::String, StringUtil::String > FontMapType;
    //FontMapType         mFontMap;   ///< Map associating the font face name with the file name

protected:
    void OnCharFontsetName( wxKeyEvent& event );
    void OnKeyUpFontsetName( wxKeyEvent& event );
    void OnKillFocusFontsetName( wxFocusEvent& event );
    void OnFontsetNameChanged( wxCommandEvent& event );
    void OnFontName( wxCommandEvent& event );
    void OnBold( wxCommandEvent& event );
    void OnUnderline( wxCommandEvent& event );
    void OnItalic( wxCommandEvent& event );
    void OnFontHeightChanged( wxCommandEvent& event );
    void OnFontWidthChanged( wxCommandEvent& event );
    void OnStartCharacterChanged( wxCommandEvent& event );
    void OnImageSizeChanged( wxCommandEvent& event );
    void OnCellHeightChanged( wxCommandEvent& event );
    void OnCellWidthChanged( wxCommandEvent& event );
    void OnAntiAlias( wxCommandEvent& event );

    /** Update the preview window */
    void UpdatePreview();
};

#endif  // FONTSETPANELEXT_H
